package module.main.model
{
	import com.darwin.darwinMVC.core.CmdNameList;
	import com.darwin.darwinMVC.mvc.Command;
	import com.darwin.darwinNet.Net;
	
	import flash.events.DataEvent;
	
	import main.AppNet;
	import main.mvc.GModelData;
	
	import module.main.cmds.MainCmdConst;
	import module.main.model.dataObj.UserInfoObj;

	public class UserInfoModelData extends GModelData
	{
		public function UserInfoModelData()
		{
			super();
			var cmd:CmdNameList = new CmdNameList(MainCmdConst.GET_USER_INFO);
			register(cmd,userInfo);
//			Net.getInstance().registerModelHandle(MainModelDataConst.GET_USER_INFO,userInfo);
		}
		
		private function userInfo(data:Object):void
		{
			var userInfo:UserInfoObj = UserInfoObj.phaseData(data["user_info"]);
			appCommonData.userInfo = userInfo;

			var cmd:Command = new Command(MainCmdConst.MAIN_CMD_USERINFO,this);
			cmd.data = userInfo;
			dispatch(cmd);
		}
	}
}